package com.amigo.online.message.controller;

import com.amigo.online.common.core.security.IgnoreSecurity;
import com.amigo.online.message.entity.MIMCTokerResponse;
import com.amigo.online.message.util.MIMCHttpUtil;
import com.amigo.online.common.base.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Api( "token")
@RestController
@RequestMapping("/im")
public class MIMCTokenController {


    /**
     * 获取 IM Token
     * @param userId
     * @return
     */
    @ApiOperation(value = "获取token" ,  notes="获取token")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户ID"),
    })
    @RequestMapping(value = "getToken", method = RequestMethod.GET)
    public MIMCTokerResponse getToken( String userId){
        MIMCTokerResponse token = MIMCHttpUtil.getToken(userId);
        return token;
    }

}
